<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>正则操作DOM</title>
  </head>
  <body>
    <p>后盾人</p>
    <h3></h3>
    <h1>
      houdunren.com
    </h1>
    <h2>hdcms.com</h2>
  </body>
  <script>
    let body = document.body;
    //\1代表第一个原子组
    let reg = /<(h[1-6])>[\s\S]*<\/\1>/gi;
    body.innerHTML = body.innerHTML.replace(reg, "");
  </script>
</html>
